package com.lanou3g.code0512.Hw0510;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet(name = "BServlet",urlPatterns = "/b")
public class BServlet extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        response.addHeader("content-Type","text/html;charset=utf-8");

        response.setHeader("Refresh","5;URL=/localhost");

        response.getWriter().println("<a href=\"/index.jsp\">5s后自动下载</a>");

    }
}
